<?php
namespace app\admin\controller;

use app\common\controller\Common;
use think\Loader;
use think\Request;
use think\captcha\Captcha;

class Set extends Common
{
    
    public function base()
    {
    	if(Request::instance()->isAjax()){

    		$data = input('post.');

    		$str = var_export($data,true);

    		$str = "<?php return ".$str." ;";

    		$res = file_put_contents(APP_PATH.'/extra/site.php',$str);
    		if($res){
    			$this->success('保存成功');
    		}
    	}else{

    		$this->assign('site',config('site'));
       		return $this->fetch();

    	}
    }

    public function test()
    {
    	$data = config('site');

    	$str = var_export($data,true);

    	$str = "<?php return ".$str." ;";

    	file_put_contents('./bb.php',$str);
    }

}